package fr.afcepf.vod.metier;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import fr.afcepf.vod.dao.IDaoVideo;
import fr.afcepf.vod.entities.Description;
import fr.afcepf.vod.entities.Tarifvideounite;
import fr.afcepf.vod.entities.Video;

@Named
public class GestionVideoImpl implements IGestionVideo {
	
	private IDaoVideo daoVideo;
	
	@Override
	public void ajouterVideo(Video video, Tarifvideounite tarif) {
		
		daoVideo.ajouterVideo(video);
		daoVideo.relierVideoEtTarif(video, tarif);
	}

	public IDaoVideo getDaoVideo() {
		return daoVideo;
	}
	
	@Inject
	public void setDaoVideo(IDaoVideo daoVideo) {
		this.daoVideo = daoVideo;
	}

	@Override
	public List<Video> getListVideo() {		
		return daoVideo.listerVideos();
	}

	@Override
	public List<Video> rechercherVideo(String intitule) {
		return daoVideo.rechercherVideo(intitule);
	}

	@Override
	public Tarifvideounite getTarifVideo(int idVideo) {
		return daoVideo.getTarifVideo(idVideo);
	}
	@Override
	public void associerDescriptionVideo(Video video, Description d){
		daoVideo.associerDescriptionVideo(video, d);
	}
	@Override
	public void dissocierDescriptionVideo(Video video, Description d){
		daoVideo.dissocierDescriptionVideo(video, d);
		
	}
	@Override
	public Video getVideoById(int idVideo){
		return daoVideo.GetVideoById(idVideo);
	}


}
